<template>
	<view class="order-product">
		<view class="header">
			<image class="img" :src="icon[orderInfo.productType]"/>
			<text class="title">{{title[orderInfo.productType]}}</text>
		</view>
		<view class="content">
			<view class="title">
				{{orderInfo.productName}}				
			</view>
			<basic-label-value label="预订日期" :value="orderInfo.createdAt" color="#999999" size="26rpx" />
			<basic-label-value label="出行日期" :value="orderInfo.checkinTime" color="#999999" size="26rpx" />
			<basic-label-value label="有效期" v-if="orderInfo.validDateStart || orderInfo.validDateEnd"  color="#999999" size="26rpx" >
				<view class="validDate">
					<span>{{orderInfo.validDateStart}}</span>
					<span v-if="orderInfo.validDateStart && orderInfo.validDateEnd">~</span>
					<span>{{orderInfo.validDateEnd}}</span>					
				</view>
			</basic-label-value>
			<basic-label-value label="套餐类型" :value="orderInfo.packageName"  color="#999999" size="26rpx" />
			<view class="subOrders">
				<span
					v-for="(item,index) in orderInfo.subOrders"
					:key="index"
				>
				{{item.skuName}} X {{item.productNum}}
				{{(index+1) === orderInfo.subOrders.length ? `` : `, `}}
				</span>				
			</view>
		</view>
	</view>
</template>
<script>
export default {
	name: 'order-product',
	props: {
		orderInfo : { type: Object, default:()=>{return null} }
	},
	data() {
		return {
			icon: { // 1-观光日游（路线）; 3-公园（门票）; 11-司机 ; 17-导游 
				1:'https://imgs.bestwehotel.com/images/inn/1boVS8ia4A',
				3:'https://imgs.bestwehotel.com/images/inn/1boVS8jnw2',
				11:'https://imgs.bestwehotel.com/images/inn/1boVS3v5L5',
				17:'https://imgs.bestwehotel.com/images/inn/1boVS8iKuF',
			},
			title: {
				1:'线路玩乐',
				3:'景点门票',
				11:'用车服务',
				17:'导领服务',
			}
		}
	}
}
</script>
<style lang="less">
.order-product{
	background: #fff;
	margin-bottom: 30rpx;
	.header{
		display: flex;
		color: #666666;
		font-size: 24rpx;
		height: 84rpx;
		background: #FAFAFA;
		align-items: center;
		box-sizing: border-box;
		padding: 20rpx;
		.img{
			width: 44rpx;
			height: 44rpx;
			margin-right: 10rpx;
		}
	}
	.content{
		padding: 30rpx;
		.title{			
			font-size: 30rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 42rpx;
			margin-bottom: 10rpx;
		}
		.subOrders{			
			font-size: 24rpx;
			font-weight: 400;
			color: #999999;
			line-height: 43rpx;
		}
	}
}
</style>